package com.jz.algorithm.Sort;

import org.junit.Test;

/**
 * @ClassName : Sort
 * @Description : 各种排序
 * @Author : Jz
 * @Date: 2021/9/1  15:53
 */
public class Sort {

    /**
     * @Methodname BubbleSort
     * @Description 冒泡排序
     * @Date 2021.10.18
     * @Created Jz
     */



    @Test
    public int[]  bubbleSort(int[] a){
        for (int j = 0; j < a.length; j++) {
            for (int i = 0; i < a.length - j - 1; i++) {
                if (a[i] > a[i + 1]) {
                    int temp = a[i];
                    a[i] = a[i + 1];
                    a[i + 1] = temp;
                }
            }
        }
        return a;

    }


}
